package top.llcngu.gateway.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author llcngu
 * @version v1.0
 * @description 使用JavaConfig的方式配置路由
 * @date 2021/4/5 19:57
 * @since v1.0
 */
@Configuration
public class RouteConfig {

    @Bean
    public RouteLocator testRouteLocator(RouteLocatorBuilder builder) {
        return builder.routes()
                .route("test_third_route", route -> route.path("/nacos").uri("http://47.115.174.6:8848"))
                .build();
    }
}
